<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <title>防止误触</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        a{
            display: block;
            line-height: 35px;
            margin:40px 0;
            font-size: 22px;
            text-align: center;
            border:1px solid blue;
        }
    </style>
</head>
<body>
<div id="box"></div>
<a href="http://www.baidu.com">百度</a>
<a href="http://www.jd.com">京东</a>
<a href="http://www.taobao.com">陶包</a>
</body>
<script>
    var a=document.querySelectorAll("a");
    for(var i=0;i<a.length;i++){
        a[i].addEventListener("touchmove",function (e) {
            //移动不跳转
            this.onOff=true;
        })
        a[i].addEventListener("touchend",function (e) {
            //一开时就没有移动,直接跳转
            if(!this.onOff){
                window.location.href=this.href;
            }
            //默认关闭开关
            this.onOff=false;
        })
    }
    document.addEventListener("touchstart",function (e) {
        e.preventDefault();
    })
</script>
</html>